#include <stdio.h>

int main(){

    int i;
    int Num;
    int digit;
    scanf("%d",&Num);
    while(Num){
        digit = Num%10;
        Num /=10;
        printf("%d ",digit);
    }
    return 0;
}